/**
 * @description 本地数据操作
 */

import { objecter, loger } from '@daelui/dogjs/dist/components.js'
import ds, { database } from './service.js'

export default {
	tableName: 'dpod_audio',
  // 查询列表(分页)
  queryListByPage (data, options) {
    options = options || {}
    options.sort = options.sort || [{ field: 'createTime', by: 'desc' }]
    return database.table(this.tableName).queryByPage(data, options)
  },
  // 查询列表
  queryList (data, options) {
    options = options || {}
    options.sort = options.sort || [{ field: 'createTime', by: 'desc' }]
    return database.table(this.tableName).select(data, options)
  },
  // 添加
  insert (data) {
    return database.table(this.tableName).insert(data)
  },
  // 更新
  update (data, options) {
    return database.table(this.tableName).update(data, options)
  },
  // 删除
  delete (data, options) {
    return database.table(this.tableName).delete(data, options)
  }
}

export {
  database
}
